<?php
session_start();
$welcome=$_SESSION['user'];
echo "<p>You are welcome $welcome</p>";

//set the values neccessary to connect to the database
$host="localhost";
$username="root";
$password="";
$db="assessmentdb";

//create the connection to the database
$connection=mysql_connect($host, $username, $password);

//select my database
$mysel=mysql_select_db($db);

$query="select * from assessment where username = \"$welcome\"";
$answer=mysql_query($query, $connection);

echo "<table  align='center'>";
echo "<tr>";
echo "<th>";
echo " ";
echo "</th>";
echo "</tr>";
echo "</table>";

echo "<table  align='center'>";
echo "<tr>";
echo "<th>";
echo " ";
echo "</th>";
echo "</tr>";
echo "</table>";

echo "<table  align='center'>";
echo "<tr>";
echo "<th>";
echo " ";
echo "</th>";
echo "</tr>";
echo "</table>";

echo "<table  align='center'>";
echo "<tr>";
echo "<th>";
echo " ";
echo "</th>";
echo "</tr>";
echo "</table>";

echo "<table  align='center'>";
echo "<tr>";
echo "<th>";
echo " ";
echo "</th>";
echo "</tr>";
echo "</table>";

echo "<table  align='center'>";
echo "<tr>";
echo "<th>";
echo " ";
echo "</th>";
echo "</tr>";
echo "</table>";

echo "<table  align='center'>";
echo "<tr>";
echo "<th>";
echo " ";
echo "</th>";
echo "</tr>";
echo "</table>";



echo "<table border='2' align='center'>";
echo "<tr>";
echo "<th>";
echo "Username";
echo "</th>";
echo "<th>";
echo "Assessment";
echo "</th>";
echo "<th>";
echo "Due Date";
echo "</th>";
echo "<th>";
echo "Date Completed";
echo "</th>";
echo "<th>";
echo "Description";
echo "</th>";
echo "</tr>";

while($row=mysql_fetch_array($answer))
{
echo "<tr>";
echo "<td>";
echo $field2= $row['username'];
echo "</td>";
echo "<td>";
echo $field3=$row['assessment'];
echo "</td>";
echo "<td>";
echo $field4=$row['duedate'];
echo "</td>";
echo "<td>";
echo $field5=$row['datecompleted'];
echo "</td>";
echo "<td>";
echo $field6=$row['description'];
echo "</td>";
echo "</tr>";

}

echo "</table>";


echo "
<html>
<head>
<title> Welcome to the Entry page</title>
</head>
<body>

<form action='entryprocess.php' method='POST'>
Assessment:<br>
<input type=\'text' name='assessment'>
<br/>
Description:<br>
<input type='text' name='description'>
<br/>
Duedate:<br>
<input type='text' name='duedate'>
<br/>
<input type='submit'value='Add Assessment'>
<input type='reset'value='Clear'>
<form>

Click <a href='editassessment.php'> Here </a>to edit assessment  
<body>
</html>
"
?>

<html>
<body bgcolor="lightblue"></body>

</html>